home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / htmlparser / nsITokenizer.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  4KB  |  109 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  26.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38.  
  39. /**
  40.  * MODULE NOTES:
  41.  * @update  gess 4/1/98
  42.  * 
  43.  */
  44.  
  45. #ifndef __NSITOKENIZER__
  46. #define __NSITOKENIZER__
  47.  
  48. #include "nsISupports.h"
  49. #include "prtypes.h"
  50.  
  51. class CToken;
  52. class nsScanner;
  53. class nsDeque;
  54. class nsTokenAllocator;
  55.  
  56. #define NS_ITOKENIZER_IID      \
  57.   {0xe4238ddc, 0x9eb6,  0x11d2, {0xba, 0xa5, 0x0,     0x10, 0x4b, 0x98, 0x3f, 0xd4 }}
  58.  
  59. /**
  60.  * This interface is used as a callback to objects interested
  61.  * in observing the token stream created from the parse process.
  62.  */
  63. class nsITokenObserver {
  64. public:
  65.   virtual PRBool  operator()(CToken* aToken)=0;
  66. };
  67.  
  68. /***************************************************************
  69.   Notes: 
  70.  ***************************************************************/
  71.  
  72.  
  73. class nsITokenizer : public nsISupports {
  74. public:
  75.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITOKENIZER_IID)
  76.  
  77.   NS_IMETHOD                     WillTokenize(PRBool aIsFinalChunk,nsTokenAllocator* aTokenAllocator)=0;
  78.   NS_IMETHOD                     ConsumeToken(nsScanner& aScanner,PRBool& aFlushTokens)=0;
  79.   NS_IMETHOD                     DidTokenize(PRBool aIsFinalChunk)=0;
  80.   
  81.   NS_IMETHOD_(CToken*)           PushTokenFront(CToken* aToken)=0;
  82.   NS_IMETHOD_(CToken*)           PushToken(CToken* aToken)=0;
  83.   NS_IMETHOD_(CToken*)           PopToken(void)=0;
  84.   NS_IMETHOD_(CToken*)           PeekToken(void)=0;
  85.   NS_IMETHOD_(CToken*)           GetTokenAt(PRInt32 anIndex)=0;
  86.   NS_IMETHOD_(PRInt32)           GetCount(void)=0;
  87.   NS_IMETHOD_(nsTokenAllocator*) GetTokenAllocator(void)=0;
  88.   NS_IMETHOD_(void)              PrependTokens(nsDeque& aDeque)=0;
  89.   NS_IMETHOD                     CopyState(nsITokenizer* aTokenizer)=0;
  90.   
  91. };
  92.  
  93. #define NS_DECL_NSITOKENIZER \
  94.   NS_IMETHOD                     WillTokenize(PRBool aIsFinalChunk,nsTokenAllocator* aTokenAllocator);\
  95.   NS_IMETHOD                     ConsumeToken(nsScanner& aScanner,PRBool& aFlushTokens);\
  96.   NS_IMETHOD                     DidTokenize(PRBool aIsFinalChunk);\
  97.   NS_IMETHOD_(CToken*)           PushTokenFront(CToken* aToken);\
  98.   NS_IMETHOD_(CToken*)           PushToken(CToken* aToken);\
  99.   NS_IMETHOD_(CToken*)           PopToken(void);\
  100.   NS_IMETHOD_(CToken*)           PeekToken(void);\
  101.   NS_IMETHOD_(CToken*)           GetTokenAt(PRInt32 anIndex);\
  102.   NS_IMETHOD_(PRInt32)           GetCount(void);\
  103.   NS_IMETHOD_(nsTokenAllocator*) GetTokenAllocator(void);\
  104.   NS_IMETHOD_(void)              PrependTokens(nsDeque& aDeque);\
  105.   NS_IMETHOD                     CopyState(nsITokenizer* aTokenizer);
  106.  
  107.  
  108. #endif
  109.